package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 视频列表访问数据库
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2022-03-22 11:30:01
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class VideosDao{

    @Resource
    private DaoHandle dao;

    public int add(final PageFormData formData){
        return dao.execute("videos.add",formData);
    }

    public String queryExistById(final String kid){
        return dao.queryForString("videos.queryExistById",kid);
    }

    public int edit(final PageFormData formData){
        return dao.execute("videos.edit",formData);
    }

    public HashMap<String,Object> queryById(final String kid){
        return dao.queryForHashMap("videos.queryById",kid);
    }

    public int delById(final String kid){
        return dao.execute("videos.delById",kid);
    }

    public int delByKeys(final ArrayList<String> list){
        return dao.execute("videos.delByKeys",list);
    }

    public HashMap<String,Object> listData(final PageFormData formData){
        return dao.queryForPage(formData,"videos.listData","videos.listTotal");
    }

    public List<Map<String, Object>> getDomainList(){
        return dao.queryForListMap("knowledge.getDomainList");
    }

    public int editFlag(final HashMap<String,Object> params){
        return dao.execute("videos.editFlag",params);
    }
}